package com.qige.homework;

public class homework3 {
    public static void main(String[] args) {
        Car car1 = new Car(ColorEnum.红色,"停车");
        Car car2 = new Car(ColorEnum.绿色,"行驶");
        Car car3 = new Car(ColorEnum.黄色,"慢行");
        System.out.println("car1 = " + car1);
        System.out.println("car2 = " + car2);
        System.out.println("car3 = " + car3);
    }
}
enum ColorEnum{
    红色,
    绿色,
    黄色
}
class Car {
    private ColorEnum color;
    private String status;

    public Car() {
    }

    public Car(ColorEnum color, String status) {
        this.color = color;
        this.status = status;
    }

    public ColorEnum getColor() {
        return color;
    }

    public void setColor(ColorEnum color) {
        this.color = color;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Car{" +
                "color=" + color +
                ", status='" + status + '\'' +
                '}';
    }
}